﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Roslyn.Compilers.Common;
using Roslyn.Services;

namespace Analysis.Rules
{
    class CyclomaticComplexityVolatileChecker : IVolatileChecker
    {
        private IRoslynHelper helper;

        public CyclomaticComplexityVolatileChecker(IRoslynHelper helper)
        {
            this.helper = helper;
        }

        public bool IsVolatile(CommonSyntaxNode node, IDocument doc)
        {
            var syntaxTree = doc.GetSyntaxTree();
            var root = syntaxTree.GetRoot();


            var ts = helper.GetTypeAndSymbol(node, doc);

            if (ts.Item1.Kind != CommonSymbolKind.Method)
                return false;

            return false;
        }
    }
}
